#include<stdio.h>
int main()
{
	int delights[10] = { 0 };
	int i, n, m;
	scanf_s("%d", &n);
	m = n;
	while (m)
	{
		i = m % 10;
		delights[i]++;
		m = m / 10;
	}
	if (n == 0) delights[0] = 1;
	for (i = 0; i <= 9; i++)
		printf("%d\t", i);
	printf("\n");
	for (i = 0; i <= 9; i++)
		printf("%d\t", delights[i]);

	




}